import Vue from 'vue'
import { URL_PREFIX } from '@/api/index'

/* /command/generate_id
生成指令编号 */
export const getGenerate_id = () => Vue.http.get(URL_PREFIX + '/command/generate_id')

/* /command/issued_scope
查询下发范围 */
export const getIssued_scope = () => Vue.http.get(URL_PREFIX + '/command/issued_scope')

/* /command/locations
列出上稿位置可选项 */
export const getManuLocations = () => Vue.http.get(URL_PREFIX + '/command/locations')

/* /command/sources
列出指令来源可选项 */
export const getSources = () => Vue.http.get(URL_PREFIX + '/command/sources')

/* /command/templates
查询反馈模板 */
export const getFeedbackTemplates = () => Vue.http.get(URL_PREFIX + '/command/templates')

/* /command/types
列出指令类型可选项 */
export const getDirectiveTypes = () => Vue.http.get(URL_PREFIX + '/command/types')

/* /command/visible
列出可视范围可选项 */
export const getVisibles = () => Vue.http.get(URL_PREFIX + '/command/visible')

/* /command/states
查询指令状态列表 */
export const getDirectiveStates = () => Vue.http.get(URL_PREFIX + '/command/states')

/* /command/add
新建指令 */
export const postDirectiveAdd = (params, data) =>
  Vue.http.post(URL_PREFIX + '/command/add', data, { params, emulateJSON: true })

/* /command/update/{id}
更新指令 */
export const postDirectiveUpdate = (id, params, data) =>
  Vue.http.post(URL_PREFIX + '/command/update/' + id, data, { params, emulateJSON: true })

/* /command/info/{id}
指令信息(详情) */
export const getCommandInfo = (id) => Vue.http.get(URL_PREFIX + '/command/info/' + id)
